import { getCurrentInstance } from 'vue'

export const contentTableConfig = {
  title: '菜单列表',
  propList: [
    { prop: 'name', label: '菜单名称', minWidth: '100' },
    { prop: 'type', label: '层级', minWidth: '100' },
    { prop: 'url', label: 'url', minWidth: '100' },
    { prop: 'permission', label: '权限', minWidth: '100', slotName: 'enable' },
    {
      prop: 'createAt',
      label: '创建时间',
      minWidth: '250',
      formatter: (row: any) => {
        return getCurrentInstance()?.appContext.config.globalProperties.$filters.formatTime(
          row.createAt
        )
        // return $filters.formatTime(row.updateAt)
      }
    },
    {
      prop: 'updateAt',
      label: '更新时间',
      minWidth: '250'
    },
    { label: '操作', minWidth: '120', slotName: 'handler' }
  ],
  showIndexColumn: false,
  showSelectColumn: false,
  childrenProps: {
    rowKey: 'id',
    treeProp: {
      children: 'children'
    }
  },
  showFooter: false
}
